﻿using UnityEngine;

namespace UFrame
{
    public class BaseBasicsUI : MonoBehaviour
    {
        public bool InitValue { get; set; }

        public EventControl eventc = new EventControl();

        public string uiName { get; set; }

        /// <summary>
        /// 第一次打开UI的时候
        /// </summary>
        /// <param name="arg"></param>
        /// <returns></returns>
        public virtual bool OnInit(object arg)
        {
            return true;
        }

        /// <summary>
        /// 每次显示UI时候
        /// </summary>
        public virtual void OnUIRefresh(object arg)
        {
            
        }

        public virtual void OnUIClose()
        {
            
        }

        public void UIDestroy()
        {
            UIBasicsMa.CloseUI(uiName);
        }

        public void UIClose()
        {
            UIBasicsMa.CloseUI(uiName);
        }
    }
}